<template>
    <div>
        <anchored-heading :level="1">Hello Word</anchored-heading>
    </div>
</template>

<script>
    import Vue from 'vue'
    Vue.component('anchored-heading', {
        render: function (createElement) {
            return createElement(
                'h' + this.level,   // 标签名称
                this.$slots.default // 子节点数组
            )
        },
        props: {
            level: {
                type: Number,
                required: true
            }
        }
    })
    export default {
        name: "render-demo01",
        methods:{
        },
        mounted() {
        }
    }
</script>

<style scoped>

</style>
